Can someone from Toronto help me out?
# support
e
I'm trying to figure out why my Vapi script is not working! @Malik @Kavin @IronMonk @nic @Uche Igbonacho @alifarahat Here is the code snippet: var vapiInstance = null; const assistant = "1234567890"; // Substitute with your assistant ID const apiKey = "1234567890"; // Substitute with your Public key from Vapi Dashboard. const buttonConfig = {}; // Modify this as required (function (d, t) { var g = document.createElement(t), s = d.getElementsByTagName(t)[0]; g.src = "https://cdn.jsdelivr.net/gh/VapiAI/html-script-tag@latest/dist/assets/index.js"; g.defer = true; g.async = true; s.parentNode.insertBefore(g, s); g.onload = function () { vapiInstance = window.vapiSDK.run({ apiKey: apiKey, // mandatory assistant: assistant, // mandatory config: buttonConfig, // optional }); }; })(document, "script"); function startConversation() { // Function to start the conversation vapiInstance.send({ type: "add-message", message: { role: "system", content: "The user has clicked to start a conversation", }, }); } Here is a link to the sample page: https://verbalist.xyz/ Thanks! https://cdn.discordapp.com/attachments/1359307039083593878/1359307040589349025/Screen_Shot_2025-04-08_at_6.52.49_PM.png?ex=67f700d5&is=67f5af55&hm=611d6397ad194e271ab533abff8045bcafdec3733e1a049914266ac1477ce615&
v
Could you please share what specific error or issue you're experiencing with your Vapi script? For example: - Are you seeing any error messages in the browser console? - Is the button not appearing at all? - Is the button appearing but not functioning when clicked? - Are you able to connect but the assistant doesn't respond correctly? This information would help me diagnose the problem more effectively. Based on your code, I notice a few potential issues: 1. You're using placeholder values for your
assistant
ID and
apiKey
("1234567890"). Have you replaced these with your actual [Vapi assistant ID and public API key](https://docs.vapi.ai/sdk/web)? 2. I see you have a
startConversation()
function defined, but I don't see where it's being called or connected to any button click event. 3. The image shows you want to make both the "Try Our A.I. Assistants" button and phone icon active, but your current implementation might not be connecting to these elements. Sources: - [Vapi Web SDK Documentation](https://docs.vapi.ai/sdk/web) - [Debugging Vapi Scripts](https://docs.vapi.ai/sdks)
k
Marking this ticket as Solved ✅ , As this will be resolved over the call.